use "G:\My Drive\Credit-Claiming Nazli_Aaron\For updated figures\CreditClaimingData from Excel with press freedom_working.dta"

stset, clear

stset duration, failure(end)

stcox claimed_per peak_size left nat  right logattacksciv log_competitor diversity shr_trans log_pop polity2 polity_sq ucdp_internal individual unknownlog if foundedafter==1 & year >1997 & gid!=669 & gid!=302, nohr nolog cluster(gid_cow)
estimates store model1

stcurve, survival at1(claimed_per=0) at2(claimed_per=0.5) at3(claimed_per=1) legend(label(1 "Claim Rate = 0") label(2 "Claim Rate = 0.5") label(3 "Claim Rate = 1") position(6) row(1))

stcurve, survival at1(claimed_per=0) at2(claimed_per=0.5) at3(claimed_per=1) ///
    legend(label(1 "Claim Rate = 0") label(2 "Claim Rate = 0.5") label(3 "Claim Rate = 1") ///
           position(6) row(1) size(small)) ///  // Small legend in a single row
		    xsize(24) ///
			ysize(16) ///
			xlabel(, notick ///  // Small x-axis labels with no ticks
			ylabel(, notick) ///  // Small y-axis labels with no ticks
			graphregion(fcolor(white)) ///  // White background
			lcolor(black) ///  // Line color for survival curves
			lwidth(thin) // Thin line for survival curves
			
graph export "survivalplot.png", width(4800) height(3200) as(png) replace
			
stcurve, survival at1(claimed_per=0) at2(claimed_per=0.5) at3(claimed_per=1) ///
    legend(label(1 "Claim Rate = 0") label(2 "Claim Rate = 0.5") label(3 "Claim Rate = 1") ///
           position(6) row(1) size(small)) ///  // Small legend in a single row
    xsize(24) ///  // Width of the graph
    ysize(16) ///  // Height of the graph
    xlabel(, notick) ///  // No x-axis ticks
    ylabel(, notick) ///  // No y-axis ticks
    graphregion(fcolor(white)) ///  // White background
    lcolor(black black black) ///  // All black lines
    lwidth(thin medium medthick) ///  // Thin lines for survival curves
    lpattern(solid longdash shortdash_dot)  // Different patterns: solid, dashed, and dotted lines

graph export "survivalplot2.png", width(4800) height(3200) as(png) replace







 
stcox claimed_log peak_size left nat  right logattacksciv log_competitor diversity shr_trans   log_pop polity2 polity_sq ucdp_internal individual unknownlog if foundedafter==1 & year >1997 & gid!=669 & gid!=302, nohr nolog cluster(gid_cow)
estimates store model2
  
stcox claimdummy peak_size left nat  right logattacksciv log_competitor diversity shr_trans   log_pop polity2 polity_sq ucdp_internal individual unknownlog if foundedafter==1 & year >1997 & gid!=669 & gid!=302, nohr nolog cluster(gid_cow)
estimates store model3






ssc install coefplot

* All three models together
coefplot (model1, label(Model 1) mcolor(black) mlabcolor(black) msymbol(D) msize(vsmall) ciopts(color(black) lwidth(vthin)) offset(0.3)) ///
         (model2, label(Model 2) mcolor(black) mlabcolor(black) msymbol(X) msize(medium) ciopts(color(black) lwidth(vthin)) offset(0)) ///
         (model3, label(Model 3) mcolor(black) mlabcolor(black) msymbol(Oh) msize(medsmall) ciopts(color(black) lwidth(vthin)) offset(-0.3)), ///
         order(claimed_per claimed_log claimdummy peak_size left nat right logattacksciv log_competitor diversity shr_trans log_pop polity2 polity_sq ucdp_internal individual unknownlog) ///
         xsize(16) ///
         ysize(24) ///
         levels(95) ///
         graphregion(fcolor(white)) ///
         xlabel(,labsize(vsmall) notick) ///
         grid(between glpattern(dash) glwidth(*0.1) glcolor(gray)) ///
         ylabel(,labsize(vsmall) notick) ///
         xline(0, lwidth(vthin) lcolor(gray) lpattern(dash)) ///
         coeflabels(claimed_per = "Claim Rate" ///
                    claimed_log = "Number of Claims (ln)" ///
                    claimdummy = "Credit Claims (dummy)" ///
                    peak_size = "Group Peak Size" ///
                    left = "Leftist Ideology" ///
                    nat = "Nationalist Ideology" ///
                    right = "Right-wing Ideology" ///
                    logattacksciv = "Attacks on Civilians (logged)" ///
                    log_competitor = "Number of Rivals (logged)" ///
                    diversity = "Attack Diversity" ///
                    shr_trans = "Share Transnational" ///
                    log_pop = "Base Country Population (ln)" ///
                    polity2 = "Base Country Polity IV" ///
                    polity_sq = "Polity Score Squared" ///
                    ucdp_internal = "UCDP Internal Conflict in Base" ///
                    individual = "Unaffiliated Attacks in Base" ///
                    unknownlog = "Unknown Attacks in Base (ln)") ///
         headings(claimed_per = "{bf:Credit Claims}" ///
                  peak_size = "{bf:Group Characteristics}" ///
                  log_pop = "{bf:Base Country Characteristics}", labcolor(black) labsize(vsmall)) ///
         legend(position(6) cols(3) size(vsmall))

graph export "figure2threemodels.png", width(3200) height(4800) as(png) replace

* Only Model 1
coefplot (model1, label(Model 1) mcolor(black) mlabcolor(black) msymbol(D) msize(vsmall) ciopts(color(black) lwidth(vthin))), ///
         order(claimed_per claimed_log claimdummy peak_size left nat right logattacksciv log_competitor diversity shr_trans log_pop polity2 polity_sq ucdp_internal individual unknownlog) ///
         xsize(16) ///
         ysize(8) ///
         levels(95) ///
         graphregion(fcolor(white)) ///
         xlabel(,labsize(vsmall) notick) ///
         grid(between glpattern(dash) glwidth(*0.1) glcolor(gray)) ///
         ylabel(,labsize(vsmall) notick) ///
         xline(0, lwidth(vthin) lcolor(gray) lpattern(dash)) ///
         coeflabels(claimed_per = "Claim Rate" ///
                    claimed_log = "Number of Claims (ln)" ///
                    claimdummy = "Credit Claims (dummy)" ///
                    peak_size = "Group Peak Size" ///
                    left = "Leftist Ideology" ///
                    nat = "Nationalist Ideology" ///
                    right = "Right-wing Ideology" ///
                    logattacksciv = "Attacks on Civilians (logged)" ///
                    log_competitor = "Number of Rivals (logged)" ///
                    diversity = "Attack Diversity" ///
                    shr_trans = "Share Transnational" ///
                    log_pop = "Base Country Population (ln)" ///
                    polity2 = "Base Country Polity IV" ///
                    polity_sq = "Polity Score Squared" ///
                    ucdp_internal = "UCDP Internal Conflict in Base" ///
                    individual = "Unaffiliated Attacks in Base" ///
                    unknownlog = "Unknown Attacks in Base (ln)") ///
         headings(claimed_per = "{bf:Credit Claims}" ///
                  peak_size = "{bf:Group Characteristics}" ///
                  log_pop = "{bf:Base Country Characteristics}", labcolor(black) labsize(vsmall)) ///
         title("Model 1: Claim Rate")

graph export "figure2model1.png", width(4800) height(2400) as(png) replace

* Only Model 2
coefplot (model2, label(Model 2) mcolor(black) mlabcolor(black) msymbol(X) msize(medium) ciopts(color(black) lwidth(vthin))), ///
         order(claimed_per claimed_log claimdummy peak_size left nat right logattacksciv log_competitor diversity shr_trans log_pop polity2 polity_sq ucdp_internal individual unknownlog) ///
         xsize(16) ///
         ysize(8) ///
         levels(95) ///
         graphregion(fcolor(white)) ///
         xlabel(,labsize(vsmall) notick) ///
         grid(between glpattern(dash) glwidth(*0.1) glcolor(gray)) ///
         ylabel(,labsize(vsmall) notick) ///
         xline(0, lwidth(vthin) lcolor(gray) lpattern(dash)) ///
         coeflabels(claimed_per = "Claim Rate" ///
                    claimed_log = "Number of Claims (ln)" ///
                    claimdummy = "Credit Claims (dummy)" ///
                    peak_size = "Group Peak Size" ///
                    left = "Leftist Ideology" ///
                    nat = "Nationalist Ideology" ///
                    right = "Right-wing Ideology" ///
                    logattacksciv = "Attacks on Civilians (logged)" ///
                    log_competitor = "Number of Rivals (logged)" ///
                    diversity = "Attack Diversity" ///
                    shr_trans = "Share Transnational" ///
                    log_pop = "Base Country Population (ln)" ///
                    polity2 = "Base Country Polity IV" ///
                    polity_sq = "Polity Score Squared" ///
                    ucdp_internal = "UCDP Internal Conflict in Base" ///
                    individual = "Unaffiliated Attacks in Base" ///
                    unknownlog = "Unknown Attacks in Base (ln)") ///
         headings(claimed_per = "{bf:Credit Claims}" ///
                  peak_size = "{bf:Group Characteristics}" ///
                  log_pop = "{bf:Base Country Characteristics}", labcolor(black) labsize(vsmall)) ///
         title("Model 2: Number of Claims (ln)")

graph export "figure2model2.png", width(4800) height(2400) as(png) replace

* Only Model 3
coefplot (model3, label(Model 3) mcolor(black) mlabcolor(black) msymbol(Oh) msize(medsmall) ciopts(color(black) lwidth(vthin))), ///
         order(claimed_per claimed_log claimdummy peak_size left nat right logattacksciv log_competitor diversity shr_trans log_pop polity2 polity_sq ucdp_internal individual unknownlog) ///
         xsize(16) ///
         ysize(8) ///
         levels(95) ///
         graphregion(fcolor(white)) ///
         xlabel(,labsize(vsmall) notick) ///
         grid(between glpattern(dash) glwidth(*0.1) glcolor(gray)) ///
         ylabel(,labsize(vsmall) notick) ///
         xline(0, lwidth(vthin) lcolor(gray) lpattern(dash)) ///
         coeflabels(claimed_per = "Claim Rate" ///
                    claimed_log = "Number of Claims (ln)" ///
                    claimdummy = "Credit Claims (dummy)" ///
                    peak_size = "Group Peak Size" ///
                    left = "Leftist Ideology" ///
                    nat = "Nationalist Ideology" ///
                    right = "Right-wing Ideology" ///
                    logattacksciv = "Attacks on Civilians (logged)" ///
                    log_competitor = "Number of Rivals (logged)" ///
                    diversity = "Attack Diversity" ///
                    shr_trans = "Share Transnational" ///
                    log_pop = "Base Country Population (ln)" ///
                    polity2 = "Base Country Polity IV" ///
                    polity_sq = "Polity Score Squared" ///
                    ucdp_internal = "UCDP Internal Conflict in Base" ///
                    individual = "Unaffiliated Attacks in Base" ///
                    unknownlog = "Unknown Attacks in Base (ln)") ///
         headings(claimed_per = "{bf:Credit Claims}" ///
                  peak_size = "{bf:Group Characteristics}" ///
                  log_pop = "{bf:Base Country Characteristics}", labcolor(black) labsize(vsmall)) ///
         title("Model 3: Credit Claims (dummy)")

graph export "figure2model3.png", width(4800) height(2400) as(png) replace











* Military or police
stset, clear
stset duration, failure(endstr==1)

stcrreg claimed_log compclaims peak_size left nat right logattacksciv log_competitor log_pop polity2 polity_sq ucdp_internal individual unknownlog log_gdp_percap if year > 1997 & gid!=669 & gid!=302, nohr nolog cluster(gid_cow) compete(endstr==2,3,4,5)
estimates store model4

* Splinter
stset, clear
stset duration, failure(endstr==2)
stcrreg claimed_log compclaims peak_size left nat right logattacksciv log_competitor log_pop polity2 polity_sq ucdp_internal individual unknownlog log_gdp_percap if year > 1997 & gid!=669 & gid!=302, nohr nolog cluster(gid_cow) compete(endstr==1,3,4,5)
estimates store model5

* Political process
stset, clear
stset duration, failure(endstr==3)
stcrreg claimed_log compclaims peak_size left nat right logattacksciv log_competitor log_pop polity2 polity_sq ucdp_internal individual unknownlog log_gdp_percap if year > 1997 & gid!=669 & gid!=302, nohr nolog cluster(gid_cow) compete(endstr==1,2,4,5)
estimates store model6

* Merger
stset, clear
stset duration, failure(endstr==4)
stcrreg claimed_log compclaims peak_size left nat right logattacksciv log_competitor log_pop polity2 polity_sq ucdp_internal individual unknownlog log_gdp_percap if year > 1997 & gid!=669 & gid!=302, nohr nolog cluster(gid_cow) compete(endstr==1,2,3,5)
estimates store model7

* Inactivity
stset, clear
stset duration, failure(endstr==5)
stcrreg claimed_log compclaims peak_size left nat right logattacksciv log_competitor log_pop polity2 polity_sq ucdp_internal individual unknownlog log_gdp_percap if year > 1997 & gid!=669 & gid!=302, nohr nolog cluster(gid_cow) compete(endstr==1,2,3,4)
estimates store model8


* Four models together
coefplot (model4, label(Model 4) mcolor(black) mlabcolor(black) msymbol(D) msize(vsmall) ciopts(color(black) lwidth(vthin)) offset(0.4)) ///
         (model5, label(Model 5) mcolor(black) mlabcolor(black) msymbol(X) msize(medium) ciopts(color(black) lwidth(vthin)) offset(0.1)) ///
		 (model7, label(Model 7) mcolor(black) mlabcolor(black) msymbol(Oh) msize(medsmall) ciopts(color(black) lwidth(vthin)) offset(-0.2)) ///
         (model8, label(Model 8) mcolor(black) mlabcolor(black) msymbol(plus) msize(medsmall) ciopts(color(black) lwidth(vthin)) offset(-0.5)), ///
         order(claimed_log compclaims peak_size left nat right logattacksciv log_competitor log_pop polity2 polity_sq ucdp_internal individual unknownlog log_gdp_percap) ///
         xsize(16) ///
         ysize(16) ///
         levels(95) ///
         graphregion(fcolor(white)) ///
         xlabel(,labsize(vsmall) notick) ///
         grid(between glpattern(dash) glwidth(*0.1) glcolor(gray)) ///
         ylabel(,labsize(vsmall) notick) ///
         xline(0, lwidth(vthin) lcolor(gray) lpattern(dash)) ///
         coeflabels(claimed_log = "Number of Claims (ln)" ///
					compclaims = "Competing Claims" ///
                    peak_size = "Group Peak Size" ///
                    left = "Leftist Ideology" ///
                    nat = "Nationalist Ideology" ///
                    right = "Right-wing Ideology" ///
                    logattacksciv = "Attacks on Civilians (logged)" ///
                    log_competitor = "Number of Rivals (logged)" ///
					log_pop = "Base Country Population (ln)" ///
                    polity2 = "Base Country Polity IV" ///
                    polity_sq = "Polity Score Squared" ///
                    ucdp_internal = "UCDP Internal Conflict in Base" ///
                    individual = "Unaffiliated Attacks in Base" ///
                    unknownlog = "Unknown Attacks in Base (ln)" ///
					log_gdp_percap = "GDP pc (logged)") ///
         headings(claimed_log = "{bf:Credit Claims}" ///
                  peak_size = "{bf:Group Characteristics}" ///
                  log_pop = "{bf:Base Country Characteristics}", labcolor(black) labsize(vsmall)) ///
         legend(cols(4) size(vsmall))

* Four models together (only claims indicator)
coefplot (model4, label(Military or Police) mcolor(black) mlabcolor(black) msymbol(D) msize(medium) ciopts(color(black) lwidth(medium)) offset(0.2)) ///
         (model5, label(Splinter) mcolor(black) mlabcolor(black) msymbol(X) msize(vlarge) ciopts(color(black) lwidth(medium)) offset(0.1)) ///
(model6, label(Political Process) mcolor(black) mlabcolor(black) msymbol(square) msize(medium) ciopts(color(black) lwidth(medium)) offset(0)) ///
		 (model7, label(Merger) mcolor(black) mlabcolor(black) msymbol(Oh) msize(large) ciopts(color(black) lwidth(medium)) offset(-0.1)) ///
         (model8, label(Inactivity) mcolor(black) mlabcolor(black) msymbol(smcircle) msize(vlarge) ciopts(color(black) lwidth(medium)) offset(-0.2)), ///
         order(peak_size claimed_log compclaims left nat right logattacksciv log_competitor log_pop polity2 polity_sq ucdp_internal individual unknownlog log_gdp_percap) ///
		 keep(claimed_log) ///
         xsize(20) ///
         ysize(12) ///
         levels(95) ///
         graphregion(fcolor(white)) ///
         xlabel(,labsize(small) notick) ///
         grid(between glpattern(dash) glwidth(*0.1) glcolor(gray)) ///
         ylabel(,labsize(small) notick) ///
         xline(0, lwidth(thin) lcolor(gray) lpattern(dash)) ///
         coeflabels(claimed_log = "Number of Claims (ln)" ///
                    compclaims = "Competing Claims" ///
					peak_size = "Group Peak Size" ///
                    left = "Leftist Ideology" ///
                    nat = "Nationalist Ideology" ///
                    right = "Right-wing Ideology" ///
                    logattacksciv = "Attacks on Civilians (logged)" ///
                    log_competitor = "Number of Rivals (logged)" ///
					log_pop = "Base Country Population (ln)" ///
                    polity2 = "Base Country Polity IV" ///
                    polity_sq = "Polity Score Squared" ///
                    ucdp_internal = "UCDP Internal Conflict in Base" ///
                    individual = "Unaffiliated Attacks in Base" ///
                    unknownlog = "Unknown Attacks in Base (ln)" ///
					log_gdp_percap = "GDP pc (logged)") ///
         legend(cols(5) size(small))

graph export "figure3fivemodels.png", width(3200) height(1920) as(png) replace

* Only military/police model
coefplot (model4, label(Military or Police) mcolor(black) mlabcolor(black) msymbol(D) msize(small) ciopts(color(black) lwidth(thin)) offset(0)), ///
         order(claimed_log compclaims peak_size left nat right logattacksciv log_competitor log_pop polity2 polity_sq ucdp_internal individual unknownlog log_gdp_percap) ///
         xsize(20) ///
         ysize(12) ///
         levels(95) ///
         graphregion(fcolor(white)) ///
         xlabel(,labsize(vsmall) notick) ///
         grid(between glpattern(dash) glwidth(*0.1) glcolor(gray)) ///
         ylabel(,labsize(vsmall) notick) ///
         xline(0, lwidth(thin) lcolor(gray) lpattern(dash)) ///
         coeflabels(claimed_log = "Number of Claims (ln)" ///
					compclaims = "Competing Claims" ///
                    peak_size = "Group Peak Size" ///
                    left = "Leftist Ideology" ///
                    nat = "Nationalist Ideology" ///
                    right = "Right-wing Ideology" ///
                    logattacksciv = "Attacks on Civilians (logged)" ///
                    log_competitor = "Number of Rivals (logged)" ///
					log_pop = "Base Country Population (ln)" ///
                    polity2 = "Base Country Polity IV" ///
                    polity_sq = "Polity Score Squared" ///
                    ucdp_internal = "UCDP Internal Conflict in Base" ///
                    individual = "Unaffiliated Attacks in Base" ///
                    unknownlog = "Unknown Attacks in Base (ln)" ///
					log_gdp_percap = "GDP pc (logged)") ///
         headings(claimed_log = "{bf:Credit Claims}" ///
                  peak_size = "{bf:Group Characteristics}" ///
                  log_pop = "{bf:Base Country Characteristics}", labcolor(black) labsize(vsmall)) ///
         legend(cols(1) size(small))

graph export "figure3militarypolice.png", width(3200) height(1920) as(png) replace

* Only splinter model
coefplot (model5, label(Splinter) mcolor(black) mlabcolor(black) msymbol(X) msize(medium) ciopts(color(black) lwidth(thin)) offset(0)), ///
         order(claimed_log compclaims peak_size left nat right logattacksciv log_competitor log_pop polity2 polity_sq ucdp_internal individual unknownlog log_gdp_percap) ///
         xsize(20) ///
         ysize(12) ///
         levels(95) ///
         graphregion(fcolor(white)) ///
         xlabel(,labsize(vsmall) notick) ///
         grid(between glpattern(dash) glwidth(*0.1) glcolor(gray)) ///
         ylabel(,labsize(vsmall) notick) ///
         xline(0, lwidth(thin) lcolor(gray) lpattern(dash)) ///
         coeflabels(claimed_log = "Number of Claims (ln)" ///
					compclaims = "Competing Claims" ///
                    peak_size = "Group Peak Size" ///
                    left = "Leftist Ideology" ///
                    nat = "Nationalist Ideology" ///
                    right = "Right-wing Ideology" ///
                    logattacksciv = "Attacks on Civilians (logged)" ///
                    log_competitor = "Number of Rivals (logged)" ///
					log_pop = "Base Country Population (ln)" ///
                    polity2 = "Base Country Polity IV" ///
                    polity_sq = "Polity Score Squared" ///
                    ucdp_internal = "UCDP Internal Conflict in Base" ///
                    individual = "Unaffiliated Attacks in Base" ///
                    unknownlog = "Unknown Attacks in Base (ln)" ///
					log_gdp_percap = "GDP pc (logged)") ///
         headings(claimed_log = "{bf:Credit Claims}" ///
                  peak_size = "{bf:Group Characteristics}" ///
                  log_pop = "{bf:Base Country Characteristics}", labcolor(black) labsize(vsmall)) ///
         legend(cols(1) size(small))

graph export "figure3splinter.png", width(3200) height(1920) as(png) replace

* Only political process model
coefplot (model6, label(Political Process) mcolor(black) mlabcolor(black) msymbol(square) msize(small) ciopts(color(black) lwidth(thin)) offset(0)), ///
         order(claimed_log compclaims peak_size left nat right logattacksciv log_competitor log_pop polity2 polity_sq ucdp_internal individual unknownlog log_gdp_percap) ///
         xsize(20) ///
         ysize(12) ///
         levels(95) ///
         graphregion(fcolor(white)) ///
         xlabel(,labsize(vsmall) notick) ///
         grid(between glpattern(dash) glwidth(*0.1) glcolor(gray)) ///
         ylabel(,labsize(vsmall) notick) ///
         xline(0, lwidth(thin) lcolor(gray) lpattern(dash)) ///
         coeflabels(claimed_log = "Number of Claims (ln)" ///
					compclaims = "Competing Claims" ///
                    peak_size = "Group Peak Size" ///
                    left = "Leftist Ideology" ///
                    nat = "Nationalist Ideology" ///
                    right = "Right-wing Ideology" ///
                    logattacksciv = "Attacks on Civilians (logged)" ///
                    log_competitor = "Number of Rivals (logged)" ///
					log_pop = "Base Country Population (ln)" ///
                    polity2 = "Base Country Polity IV" ///
                    polity_sq = "Polity Score Squared" ///
                    ucdp_internal = "UCDP Internal Conflict in Base" ///
                    individual = "Unaffiliated Attacks in Base" ///
                    unknownlog = "Unknown Attacks in Base (ln)" ///
					log_gdp_percap = "GDP pc (logged)") ///
         headings(claimed_log = "{bf:Credit Claims}" ///
                  peak_size = "{bf:Group Characteristics}" ///
                  log_pop = "{bf:Base Country Characteristics}", labcolor(black) labsize(vsmall)) ///
         legend(cols(1) size(small))

graph export "figure3politicalprocess.png", width(3200) height(1920) as(png) replace


* Only merger model
coefplot (model7, label(Merger) mcolor(black) mlabcolor(black) msymbol(Oh) msize(medium) ciopts(color(black) lwidth(thin)) offset(0)), ///
         order(claimed_log compclaims peak_size left nat right logattacksciv log_competitor log_pop polity2 polity_sq ucdp_internal individual unknownlog log_gdp_percap) ///
         xsize(20) ///
         ysize(12) ///
         levels(95) ///
         graphregion(fcolor(white)) ///
         xlabel(,labsize(vsmall) notick) ///
         grid(between glpattern(dash) glwidth(*0.1) glcolor(gray)) ///
         ylabel(,labsize(vsmall) notick) ///
         xline(0, lwidth(thin) lcolor(gray) lpattern(dash)) ///
         coeflabels(claimed_log = "Number of Claims (ln)" ///
					compclaims = "Competing Claims" ///
                    peak_size = "Group Peak Size" ///
                    left = "Leftist Ideology" ///
                    nat = "Nationalist Ideology" ///
                    right = "Right-wing Ideology" ///
                    logattacksciv = "Attacks on Civilians (logged)" ///
                    log_competitor = "Number of Rivals (logged)" ///
					log_pop = "Base Country Population (ln)" ///
                    polity2 = "Base Country Polity IV" ///
                    polity_sq = "Polity Score Squared" ///
                    ucdp_internal = "UCDP Internal Conflict in Base" ///
                    individual = "Unaffiliated Attacks in Base" ///
                    unknownlog = "Unknown Attacks in Base (ln)" ///
					log_gdp_percap = "GDP pc (logged)") ///
         headings(claimed_log = "{bf:Credit Claims}" ///
                  peak_size = "{bf:Group Characteristics}" ///
                  log_pop = "{bf:Base Country Characteristics}", labcolor(black) labsize(vsmall)) ///
         legend(cols(1) size(small))

graph export "figure3merger.png", width(3200) height(1920) as(png) replace


* Only Inactivity model
coefplot (model8, label(Inactivity) mcolor(black) mlabcolor(black) msymbol(smcircle) msize(medium) ciopts(color(black) lwidth(thin)) offset(0)), ///
         order(claimed_log compclaims peak_size left nat right logattacksciv log_competitor log_pop polity2 polity_sq ucdp_internal individual unknownlog log_gdp_percap) ///
         xsize(20) ///
         ysize(12) ///
         levels(95) ///
         graphregion(fcolor(white)) ///
         xlabel(,labsize(vsmall) notick) ///
         grid(between glpattern(dash) glwidth(*0.1) glcolor(gray)) ///
         ylabel(,labsize(vsmall) notick) ///
         xline(0, lwidth(thin) lcolor(gray) lpattern(dash)) ///
         coeflabels(claimed_log = "Number of Claims (ln)" ///
					compclaims = "Competing Claims" ///
                    peak_size = "Group Peak Size" ///
                    left = "Leftist Ideology" ///
                    nat = "Nationalist Ideology" ///
                    right = "Right-wing Ideology" ///
                    logattacksciv = "Attacks on Civilians (logged)" ///
                    log_competitor = "Number of Rivals (logged)" ///
					log_pop = "Base Country Population (ln)" ///
                    polity2 = "Base Country Polity IV" ///
                    polity_sq = "Polity Score Squared" ///
                    ucdp_internal = "UCDP Internal Conflict in Base" ///
                    individual = "Unaffiliated Attacks in Base" ///
                    unknownlog = "Unknown Attacks in Base (ln)" ///
					log_gdp_percap = "GDP pc (logged)") ///
         headings(claimed_log = "{bf:Credit Claims}" ///
                  peak_size = "{bf:Group Characteristics}" ///
                  log_pop = "{bf:Base Country Characteristics}", labcolor(black) labsize(vsmall)) ///
         legend(cols(1) size(small))

graph export "figure3inactivity.png", width(3200) height(1920) as(png) replace


















